import { type } from "os"

// 排序规则
interface Iorders {
    asc: Boolean | undefined
    column: String | undefined
}

// 商品上架状态
interface IshelfState {
    id: Number | undefined
    label: String | undefined
}

// 商品类别
interface Icategorylist {
    categoryId: String | undefined
    categoryName: String | undefined
    showSequence: Number | undefined
}

// 	商品查询参数
class ProductQueryParam {
    categoryId: Number | undefined
    current: Number | undefined
    onShelf: Number | undefined
    orders: Iorders | undefined
    productName: String | undefined
    size: Number | undefined
    stock: Number | undefined
    constructor(
        categoryId: Number,
        current: Number,
        onShelf: Number,
        orders: Iorders,
        productName: String,
        size: Number,
        stock: Number,
    ) {
        this.categoryId = categoryId;
        this.current = current;
        this.onShelf = onShelf;
        this.orders = orders;
        this.productName = productName;
        this.size = size;
        this.stock = stock;
    }
}


// 向用户展示具体数据
class UserViewData {
    productQueryParam: ProductQueryParam = {
        categoryId: 0,
        current: undefined,
        onShelf: -1,
        orders: undefined,
        productName: undefined,
        size: undefined,
        stock: undefined,
    };
    page: Ipage = {
        current: 1,
        size: 10,
        total: 10
    };
    categorylist: Icategorylist[] = [];
    shelfState: IshelfState[] = [{ id: 0, label: "下架" }, { id: 1, label: "上架" }]
    tableData: [] | undefined
    edit: any = {
        show: false,
        title: null,
        list: {}
    }

}

// 接口打出需要使用 type
export type {
    Iorders,
    IshelfState,
    Icategorylist,
}

export {
    ProductQueryParam,
    UserViewData
}